var app=getApp();
Page({
    data: {
        inputShowed: false,
        inputVal: "",
        cards:[]
    },
    onLoad:function(){
    },
    onReady:function(){
        var tmp=this;
        wx.request({
          url: app.host+app.path+'cards',
          data: {
              sss:app.s3()
          },
          method: 'POST',
          success: function(res){
           tmp.setData({
               cards:JSON.parse(res.data)
           })
          },
          fail: function() {
            // fail
          },
          complete: function() {
            // complete
          }
        })
    },
    showInput: function () {
        this.setData({
            inputShowed: true
        });
    },
    hideInput: function () {
        this.setData({
            inputVal: "",
            inputShowed: false
        });
    },
    clearInput: function () {
        this.setData({
            inputVal: ""
        });
    },
    inputTyping: function (e) {
        this.setData({
            inputVal: e.detail.value
        });
    },
    //打电话
    callnumber:function(e){
        var tmp=this;
       wx.makePhoneCall({
            phoneNumber: e.target.dataset.num
       })
    },
    //retuntomycard
    returnmycard:function(){
        app.to('../../pages/card/card');
    }
});